import 'package:flutter_test/flutter_test.dart';
import 'package:calcengine_flutter_libs/calcengine_flutter_libs.dart';
import 'package:calcengine_flutter_libs/calcengine_flutter_libs_platform_interface.dart';
import 'package:calcengine_flutter_libs/calcengine_flutter_libs_method_channel.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

class MockCalcengineFlutterLibsPlatform
    with MockPlatformInterfaceMixin
    implements CalcengineFlutterLibsPlatform {

  @override
  Future<String?> getPlatformVersion() => Future.value('42');
}

void main() {
  final CalcengineFlutterLibsPlatform initialPlatform = CalcengineFlutterLibsPlatform.instance;

  test('$MethodChannelCalcengineFlutterLibs is the default instance', () {
    expect(initialPlatform, isInstanceOf<MethodChannelCalcengineFlutterLibs>());
  });

  test('getPlatformVersion', () async {
    CalcengineFlutterLibs calcengineFlutterLibsPlugin = CalcengineFlutterLibs();
    MockCalcengineFlutterLibsPlatform fakePlatform = MockCalcengineFlutterLibsPlatform();
    CalcengineFlutterLibsPlatform.instance = fakePlatform;

    expect(await calcengineFlutterLibsPlugin.getPlatformVersion(), '42');
  });
}
